home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 4 / Precision Software Applications Silver Collection Volume 4 (1993).iso / stats / matcal11.exe / MATCALC.DOC next >
Text File  |  1992-05-25  |  15KB  |  576 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                               Matrix Calculator
  15.  
  16.                                  version 1.1
  17.  
  18.  
  19.                          (C) 1991,  Wesley B. Loewer
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                               Table of Contents
  42.  
  43.         Topic                                                          Page
  44.    Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  45.    Latest Version  . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  46.    Entering New Matrices . . . . . . . . . . . . . . . . . . . . . . . .  3
  47.    Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3
  48.    File options  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  49.    Edit options  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  50.    Operations options  . . . . . . . . . . . . . . . . . . . . . . . . .  6
  51.    In Closing  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                Manual Updated: May 25, 1992
  64.  
  65.  
  66.  
  67.                                                                      Page 2
  68.  
  69.    Introduction:
  70.         This piece  of software allows a  user to  perform matrix operations
  71.    quickly and  easily on  large matrices.   It has  optimized routines  for
  72.    finding inverses,  determinants, matrix multiplication and addition and a
  73.    number  of  other  operations as  well.   It  allows  the  user  to store
  74.    matrices  in such a  way that  makes it  easy to  import into spreadsheet
  75.    programs.
  76.  
  77.    The Latest Version:
  78.    The latest version of "MatCalc" can be found at
  79.  
  80.                             Data Warp Premium BBS
  81.                                 (713) 355-6107
  82.                                   Spring, TX
  83.  
  84.    "MatCalc" is  distributed as  MATCAL??.ZIP, where the  ?? represents  the
  85.    version   number.    When  passing  "MatCalc"  along  to  others,  please
  86.    distribute all the files and documentation.   Currently, the ZIP contains
  87.    the files MATCALC.EXE and MATCALC.DOC.  See the end of  this file for the
  88.    conditions in which this program may be used without charge.
  89.  
  90.    Limitations:
  91.         The  size of a  matrix is limited  to 50 rows  and 50  columns.  The
  92.    number of matrices that  can be stored in memory  at one time  depends on
  93.    size  of each matrix.  There  is enough room to store ten 25x25 matrices.
  94.  
  95.  
  96.    Hardware Requirements:
  97.         This program  requires an IBM compatible with DOS 2.0 or  later.  It
  98.    does  not require  any graphics  capability  what-so-ever.   The  program
  99.    makes use of an optional mouse and math coprocessor
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                           Matrix Calculator
  128.  
  129.  
  130.  
  131.                                                                      Page 3
  132.  
  133.    Getting Started:
  134.         To start  the program, type MATCALC at the DOS prompt.   The opening
  135.    screen should look like:
  136.  
  137.                            ╔════════════════════════════╗
  138.                            ║                            ║
  139.                            ║      Matrix Calculator     ║
  140.                            ║                            ║
  141.                            ╟────────────────────────────╢
  142.                            ║ (C) 1991, Wesley B. Loewer ║
  143.                            ╚════════════════════════════╝
  144.  
  145.  
  146.    To  make a selection, hold the  <ALT> key down and press  the letter that
  147.    is highlighted on  the menu; or  place the  mouse point on the  selection
  148.    and  click the left mouse button.  If you are  not in the editing screen,
  149.    holding the <ALT> key is not necessary.
  150.  
  151.  
  152.    ┌────────────────────╖
  153.    │ New                ║
  154.    │ Retrieve File      ║
  155.    │ Retrieve Text File ║
  156.    ╘════════════════════╝
  157.    New - To enter a completely new matrix, leads to the following menu.
  158.    Retrieve File - prompts you to enter the name of a binary matrix file.
  159.    Retrieve Text File  - prompts you  to enter the  name of a  tab or  comma
  160.         delimited ASCII text file
  161.  
  162.         If "New" was selected above, then the following menu appears:
  163.         ┌───────────────╖
  164.         │ Matrix        ║
  165.         │ Single Number ║
  166.         ╘═══════════════╝
  167.         Matrix - indicates that you want to enter a matrix
  168.         Single Number - The Matrix Calculator can also handle real numbers.
  169.  
  170.              If you selected "Matrix" then the next menu appears:
  171.              ┌──────────────────────────╖
  172.              │ Number of Rows:     3    ║
  173.              │ Number of Columns:  3    ║
  174.              ╘══════════════════════════╝
  175.              This menu is asking you  to enter the size of the matrix.   For
  176.              a  matrix of size  MxN, M is  the number of  rows and  N is the
  177.              number of columns.
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.                                                           Matrix Calculator
  192.  
  193.  
  194.  
  195.                                                                      Page 4
  196.  
  197.    Editing:
  198.    At this point,  the Matrix Calculator  shows an editing  screen in  which
  199.    you  may enter values  for the  matrix or  single number.   The following
  200.    keys have special meaning in the editing screen.
  201.  
  202.    <F2> - Toggles between "Edit Mode" and "View Mode."
  203.  
  204.    <Left>/<Right  Arrow>  -  In  "Edit  Mode"  causes  the  cursor  to  move
  205.         left/right  in the edit window.   In "View Mode" causes the selected
  206.         cell to move right/left.
  207.  
  208.    <Up>/<Down Arrow> - Causes the selected cell to move up/down.
  209.  
  210.    <Tab>/<Shift-Tab> - Causes the selected cell to move right/left.
  211.  
  212.    <Home>/<End>  -  In  "Edit  Mode"  causes  the  cursor  to  move  to  the
  213.         beginning/end of  the entry.   In  "View Mode"  causes the  selected
  214.         cell to be the first/last cell in the row.
  215.  
  216.    <Ctrl-Home>/<Ctrl-End> - Causes the  selected cell to  be the  first/last
  217.         cell in the matrix.
  218.  
  219.    <Left Mouse Button>  - Clicking  the left  mouse button  on a  particular
  220.         cell causes that cell to be selected.
  221.  
  222.  
  223.  
  224.    Working with Matrices:
  225.         Once a matrix has been entered, a number  of things can be done with
  226.    the matrix.  At the top  of the screen a list of three main categories is
  227.    shown:  File, Edit, and Operations.   Each option under these headings is
  228.    explained below.
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.                                                           Matrix Calculator
  256.  
  257.  
  258.  
  259.                                                                      Page 5
  260.  
  261.    File options:
  262.    ┌────────────────────╖
  263.    │ Save               ║
  264.    │ Retrieve           ║
  265.    │ Save as Text File  ║
  266.    │ Retrieve Text File ║
  267.    │ Delete             ║
  268.    ├────────────────────╢
  269.    │ Print              ║
  270.    ├────────────────────╢
  271.    │ Exit        Ctrl+X ║
  272.    ╘════════════════════╝
  273.  
  274.    Save -  Saves the current matrix (matrix  #0) as a binary file.  The size
  275.         of  the  file  will  always  be  (rows x cols + 1) x 8  bytes  long.
  276.         Binary files  can  be saved  and  retrieved  much faster  than  text
  277.         files.
  278.  
  279.    Retrieve - Retrieves a binary file replacing the current matrix.
  280.  
  281.    Save as Text  File -  Saves the  current matrix  as an  ASCII text  file.
  282.         This allows the files to be  imported by other spreadsheet programs.
  283.         If the  elements are mostly integers, then the size of  the file can
  284.         be considerably  smaller than that of  a binary file.   On the other
  285.         hand,  if the elements  have mostly  long decimals,  then text files
  286.         can be  bigger than binary  files.  In  any case,  using text  files
  287.         always take more time to save and retrieve.
  288.  
  289.    Retrieve Text File - Retrieves a text file replacing the current matrix.
  290.  
  291.    Delete - Prompts the user to enter a filename to delete.
  292.  
  293.    Print - Prints the current matrix to a printer connected to PRN:
  294.  
  295.    Exit - Leaves the program.  (Short-cut key is <Ctrl-X>.)
  296.  
  297.  
  298.  
  299.  
  300.    Edit options:
  301.    ┌────────────────────────╖
  302.    │ Edit/view mode      F2 ║
  303.    │ Store           Ctrl+S ║
  304.    │ Recall          Ctrl+R ║
  305.    │ New             Ctrl+N ║
  306.    │ Clear                  ║
  307.    │ Clear All              ║
  308.    ╘════════════════════════╝
  309.  
  310.    Edit/view mode - Toggle between "Edit  Mode" and "View Mode."  (Short-cut
  311.         key is <F2>.)
  312.  
  313.    Store - Stores the current matrix in a memory location.   Valid locations
  314.         are memory #1 - memory #9.  (Short-cut key is <Ctrl-S>.)
  315.  
  316.  
  317.  
  318.  
  319.                                                           Matrix Calculator
  320.  
  321.  
  322.  
  323.                                                                      Page 6
  324.  
  325.    Recall  -  Replaces the  current matrix  with  the  matrix from  a memory
  326.         location.   Valid locations are  memory #1 - memory  #9.  (Short-cut
  327.         key is <Ctrl-R>.)
  328.  
  329.    New - Clears the current matrix and allows the user to enter a new one.
  330.  
  331.    Clear - Clears a particular memory location.   Valid locations are memory
  332.         #1 - memory #9.
  333.  
  334.    Clear  All -  Clears all  the memory  location except the  current matrix
  335.         which is stored in memory #0.
  336.  
  337.  
  338.  
  339.    Operations options:
  340.    ┌───────────────────────────╖
  341.    │ Solve System of Equations ║
  342.    │ Determinant               ║
  343.    │ Add                       ║
  344.    │ Multiply                  ║
  345.    │ Inverse                   ║
  346.    │ Transpose                 ║
  347.    │ Adjoint                   ║
  348.    │ Minor                     ║
  349.    │ Cofactor                  ║
  350.    │ Trace                     ║
  351.    │ Identity                  ║
  352.    ╘═══════════════════════════╝
  353.  
  354.    Solve System  of Equations  - Allows  the user  to very  quickly solve  a
  355.         system  of linear equations.  The matrix must have more columns than
  356.         rows in order to use this option.
  357.         Example: 3x + 2y = 1 and  -x + y = 12 can be  solved for x and  y by
  358.         entering the matrix:
  359.                   3    2    1
  360.                   -1   1    12
  361.         and  selecting  "Solve  System  of  Equations."    The  answers  are
  362.         displayed  in order in a column.  You can also solve this system and
  363.         another at the same time if  both system have the same coefficients.
  364.         For example: 3x + 2y  = 5 and -x +  y = 6 can  be solved along  with
  365.         the previous system by entering:
  366.                   3    2    1    5
  367.                   -1   1    12   6
  368.         and again select "Solve System  of Equations."  The first (x,y) pair
  369.         will be the first column while  the second (x,y) pair  is the second
  370.         column.
  371.  
  372.    Determinant -  Finds the determinant  of the current matrix.   The matrix
  373.         must have the same  number of rows and columns  in order to use this
  374.         option.
  375.  
  376.    Add - Adds the current  matrix to another matrix.  In order to use  this,
  377.         you must have already stored a matrix somewhere in memory.   You can
  378.         add a matrix to itself by  selecting memory #0.   Both matrices used
  379.         must be the exact same size.
  380.  
  381.  
  382.  
  383.                                                           Matrix Calculator
  384.  
  385.  
  386.  
  387.                                                                      Page 7
  388.  
  389.    Multiply - Multiplies the current matrix times  another matrix.  In order
  390.         to use  this, you must  have already  stored a  matrix somewhere  in
  391.         memory.   You can multiply  a matrix by  itself by selecting  memory
  392.         #0.  The  number of columns of the  current matrix must be equal  to
  393.         the number  of rows  in  the selected  memory location.   If  either
  394.         value  is  a  single  number  instead   of  a  matrix,  then  scaler
  395.         multiplication is performed.
  396.  
  397.    Inverse - Finds the inverse of the current matrix.  The matrix must  have
  398.         the same  number of  rows and columns in  order to use  this option.
  399.         There is a size limit of 25x25 for this operation.
  400.  
  401.    Transpose - Exchanges the rows and columns of the current matrix.
  402.  
  403.    Adjoint -  Finds  the adjoint  (sometimes  called  the adjugate)  of  the
  404.         current matrix.
  405.  
  406.    Minor  - Finds  a minor  of a  particular row  and column  of the current
  407.         matrix.
  408.  
  409.    Cofactor -  Finds the  cofactor of  a particular  row and  column of  the
  410.         current matrix.
  411.  
  412.    Trace - Finds the trace (the sum of the diagonal) of the current matrix.
  413.  
  414.    Identity - Generates an identity matrix of a specified size.
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.                                                           Matrix Calculator
  448.  
  449.  
  450.  
  451.                                                                      Page 8
  452.  
  453.                                    History
  454.  
  455.    1.0  Original program
  456.  
  457.    1.1  A few typo's were  corrected in the documentation  and a few message
  458.         screens were slightly changed
  459.  
  460.         First version to be distributed through Data Warp BBS (see p. 2)
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.                                                           Matrix Calculator
  512.  
  513.  
  514.  
  515.                                                                      Page 9
  516.  
  517.                                   In Closing
  518.  
  519.    A special word of thanks goes to my  Physics and Algebra II students  who
  520.    unknowingly  were  my  beta testers.   They  are the  reason I  put these
  521.    programs together and made them publicly available.
  522.  
  523.    This program  is intended  for use  in educational settings  only.  As  a
  524.    teacher,  my  reward  comes  from  knowing  that  my  efforts  have  been
  525.    fruitful.   Although  donations  would be  appreciated, the  only payment
  526.    that  I require is  that each  user send a letter  or postcard letting me
  527.    know that he/she is using my program.  Teachers  may send a single letter
  528.    with the names  (or at least  the number)  of students using the  program
  529.    each  year.  This serves no purpose  other than to give the  author a pat
  530.    on the back and make him feel as though he has contributed to mankind.
  531.  
  532.    If this program should  prove useful to someone outside of an educational
  533.    setting (such as in a job or even research), a reasonable payment of  $15
  534.    is required.  If anyone is  interested in the source code, please contact
  535.    me.
  536.  
  537.                   Copyright is retained by Wesley B. Loewer.
  538.  
  539.    Please send any questions, suggestions, and contributions to:
  540.  
  541.         Wesley B. Loewer          or     Wesley B. Loewer
  542.         78 S. Circlewood Glen            McCullough High School
  543.         The Woodlands, TX  77381         3800 S. Panther Creek Dr.
  544.         (713) 292-3449                   The Woodlands, TX  77381
  545.                                          (713) 367-1025 ext. 251
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.                                                           Matrix Calculator
  576.